<% content_for :title do %>Display all products<% end %>
<h1>All Products in the Product Table!</h1>

<div class="notice-area">
	<%= notice %>
</div>

<table class="table">
	<thead>
		<tr>
			<th>Name</th>
			<th>Description</th>
			<th>Pricing</th>
			<th>Category</th>
		</tr>
	</thead>

	<tbody>
		<% @products.each do |product| %>
			<tr>
				<td><%= product.name %></td>
				<td><%= product.description %></td>
				<td><%= product.pricing %></td>
				<td><%= product.category.name %></td>
				<td><%= link_to 'Show', product_path(product) %></td>
				<td><%= link_to 'Edit', edit_product_path(product) %></td>
				<td><%= link_to 'Destroy', product_path(product), method: :delete, data: { confirm: 'Are you sure?' } %></td>
			</tr>
		<% end %>
	</tbody>

</table>

<%= link_to "Add Product", new_product_path %>
